package org.asiaark.developerstudio.command;

/**
 * 分页控制
 * 
 * @author Ivan
 * 
 */
public class PageCommand {

	private int pageNum;// 当前页数
	private int pageSize;// 每页条数
	private long total;// 总条数
	private long totalPage;// 总页面数

	public PageCommand() {
		pageNum = 1;
		pageSize = 10;
		totalPage = 1;
	}

	public long getTotal() {
		return total;
	}

	public void setTotal(long total) {
		this.total = total;
	}

	public int getPageNum() {
		return pageNum;
	}

	public void setPageNum(int pageNum) {
		this.pageNum = pageNum;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public long getTotalPage() {
		totalPage = (int) Math.ceil((double) total / pageSize);
		return totalPage;
	}

	public void setTotalPage(long totalPage) {
		this.totalPage = totalPage;
	}

}
